var siteSelect = {
    timer : '',

    show : function(){
        $("#siteSelectInner").animate({ left: 0}, 400);
    },

    hideCallback : function(){
        $("#siteSelectInner").animate({ left: -300}, 400);
    },

    hide: function(){
        //$("#siteSelectInner").animate({ left: -300}, 400);
        this.timer = setTimeout("siteSelect.hideCallback()", 400);
    },

    clearTimeout : function(){
        clearTimeout(siteSelect.timer);
    }
}


$(document).ready(function ()
{
    var skolaUrl = "http://localhost/aircentrum/";
    var tandemUrl = "http://paragliding-tandem.cz";
    var firemniUrl = "http://firemni-akce.aircentrum.cz";
    
    $("#header").append("<div id=\"siteSelect\"><div id=\"siteSelectInner\"><p><a href=\"" + skolaUrl + "\" class=\"skola\">Škola paraglidingu</a></p><p><a href=\"" + tandemUrl + "\" class=\"tandem\">Paragliding tandem</a></p><p><a class=\"firemni\" href=\"" + firemniUrl + "\">Firemní a skupinové akce</a></p></div></div>");
    
    $("#logoLink").mouseover(function(){
        siteSelect.clearTimeout();
        siteSelect.show();
    });
    
    $("#logoLink, #siteSelectInner").mouseout(function(){
        siteSelect.hide();
    });
    
    $("#siteSelectInner").mouseover(function(){
        siteSelect.clearTimeout();
    });
        
});

